package com.df.excel_export;

import com.df.excel_export.common.ExportTask;
import com.df.excel_export.project_config.ProjectConfig;

import java.util.concurrent.CountDownLatch;

public class TaskTest {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(1);
        Thread t = new Thread(()->{
            try {
                System.out.println(1);
                end();
                if(Thread.currentThread().isInterrupted()){
                    System.out.println(Thread.currentThread().isInterrupted());
                    return;
                }
                System.out.println(2);
            }catch (Exception e){

            }finally {
                System.out.println("结束");
                latch.countDown();
            }

        });
        t.start();
        latch.await();
    }

    public static void end(){
        Thread.currentThread().interrupt();
    }

    public static void test1(){
        ProjectConfig projectConfig = new ProjectConfig();
        projectConfig.setExcel_path("D:\\Project\\excel_export\\doc\\testexcels");
        projectConfig.setTable_prefix("t_");
        projectConfig.setName("test");
        ExportTask task = new ExportTask();
        task.setProjectConfig(projectConfig);
        task.parseProjectAllTableMeta();
    }
}
